package com.aaa.behind.controller;


import com.aaa.behind.service.IEMessageService;
import com.aaa.entity.EMessage;
import com.aaa.util.PageInfo;
import com.aaa.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 系统通知表 前端控制器
 * </p>
 *
 * @author whj
 * @since 2023-02-06
 */
@RestController
@RequestMapping("/e-message")
public class EMessageController {


    @Autowired
    private IEMessageService eMessageService;

    @PostMapping("getMessage")
    public Result getMessage(@ModelAttribute PageInfo pageInfo, String startTime,String endTime ){
        return new Result(eMessageService.getMessage(pageInfo,startTime,endTime));
    }

    @PostMapping("updateMessage")
    public Result updateMessage(EMessage eMessage){
        return new Result(eMessageService.saveOrUpdate(eMessage));
    }

}

